package com.keepmoving.service.impl;

import com.keepmoving.dao.CourseDao;
import com.keepmoving.po.Course;
import com.keepmoving.service.CourseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xf
 * 课程业务类实现类
 */
@Service
public class CourseServiceImpl implements CourseService {

    @Resource
    CourseDao courseDao;

    @Override
    public List<Course> findAll() {
        return courseDao.findAll();
    }

    @Override
    public Course findByCoId(int cId) {
        return courseDao.findByCoId(cId);
    }

    @Override
    public boolean addCourse(Course course) {
        return courseDao.addCourse(course) > 0 ? true : false;
    }

    @Override
    public boolean deleteCourse(int cId) {
        return courseDao.deleteCourse(cId) > 0 ? true : false;
    }

    @Override
    public boolean updateCourse(Course course) {
        return courseDao.updateCourse(course) > 0 ? true : false;
    }
}
